class Solution:
    def winningPlayerCount(self, n: int, pick: List[List[int]]) -> int:
        i_pick = dict()
        wins = set()
        for i in range(n):
            i_pick[i] = [0] * 11
        for p in pick:
            i_pick[p[0]][p[1]] += 1
            if i_pick[p[0]][p[1]] > p[0]:
                wins.add(p[0])
        return len(wins)

if __name__ == "__main__":
    s = Solution()
    print(s.winningPlayerCount(n = 4, pick = [[0,0],[1,0],[1,0],[2,1],[2,1],[2,0]]))
    print(s.winningPlayerCount(n = 5, pick = [[1,1],[1,2],[1,3],[1,4]]))
    print(s.winningPlayerCount(n = 5, pick = [[1,1],[2,4],[2,4],[2,4]]))